package crm.view.home;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SpringLayout;
import javax.swing.JSeparator;
import javax.swing.JButton;

import crm.controller.CampaignHomeController;
import crm.controller.LeadHomeController;
import crm.view.campaign.CampaignHome;
import crm.view.campaign.CampaignView;
import crm.view.leeds.LeadHomeView;
import crm.viewframework.UIFrameWork;


public class HomeView extends JPanel implements ActionListener
{


	private JButton btnEmail;
	private SpringLayout springLayout;
	private JButton btnSms;
	private LeadHomeView LeadPanel;
	private CampaignHome CampaignPanel;
	
	public HomeView() 
	{
		SpringLayout springLayout = new SpringLayout();
		setLayout(springLayout);
				
		btnSms = new JButton("SEND SMS");
		springLayout.putConstraint(SpringLayout.NORTH, btnSms, 10, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.EAST, btnSms, -100, SpringLayout.EAST, this);
		add(btnSms);
		
		btnEmail = new JButton("SEND MAIL");
		springLayout.putConstraint(SpringLayout.WEST, btnEmail, 6, SpringLayout.EAST, btnSms);
		springLayout.putConstraint(SpringLayout.SOUTH, btnEmail, 0, SpringLayout.SOUTH, btnSms);
		add(btnEmail);
		
		JSeparator separator = new JSeparator();
		//springLayout.putConstraint(SpringLayout.NORTH, separator, 68, SpringLayout.SOUTH, LeadPanel);
		springLayout.putConstraint(SpringLayout.WEST, separator, 0, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.NORTH, separator, 300, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.EAST, separator, 0, SpringLayout.EAST, this);
		add(separator);
		
		
		LeadPanel = new LeadHomeView();
		springLayout.putConstraint(SpringLayout.NORTH, LeadPanel, 20, SpringLayout.SOUTH, btnSms);
		springLayout.putConstraint(SpringLayout.WEST, LeadPanel, 5, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, LeadPanel, -20, SpringLayout.SOUTH,separator );
		springLayout.putConstraint(SpringLayout.EAST, LeadPanel, 0, SpringLayout.EAST, this);
		add(LeadPanel);
		LeadPanel.getBtnSendMail().setVisible(false);
		LeadPanel.getBtnSendMessage().setVisible(false);

		
		
		
		CampaignPanel = new CampaignHome();
		springLayout.putConstraint(SpringLayout.NORTH, CampaignPanel, 20, SpringLayout.SOUTH, separator);
		springLayout.putConstraint(SpringLayout.WEST, CampaignPanel, 5, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, CampaignPanel, -20, SpringLayout.SOUTH, this);
		springLayout.putConstraint(SpringLayout.EAST, CampaignPanel, -5, SpringLayout.EAST, this);
		add(CampaignPanel);
		
		
	}
	
	

	public JButton getBtnEmail() {
		return btnEmail;
	}



	public void setBtnEmail(JButton btnEmail) {
		this.btnEmail = btnEmail;
	}



	public SpringLayout getSpringLayout() {
		return springLayout;
	}



	public void setSpringLayout(SpringLayout springLayout) {
		this.springLayout = springLayout;
	}



	public JButton getBtnSms() {
		return btnSms;
	}



	public void setBtnSms(JButton btnSms) {
		this.btnSms = btnSms;
	}



	public LeadHomeView getLeadPanel() {
		
		return LeadPanel;
	}



	public void setLeadPanel(LeadHomeView leadPanel) {
		LeadPanel = leadPanel;
	}



	public CampaignHome getCampaignPanel() {
		return CampaignPanel;
	}



	public void setCampaignPanel(CampaignHome campaignPanel) {
		CampaignPanel = campaignPanel;
	}



	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		
		}
		
	

}
